#include <QApplication>
#include <QMessageBox>
#include <QtPlugin>

#include <updater.h>
#include <mainwindow.h>

int main(int argc, char * argv[])
{
    QApplication app(argc, argv);

    qRegisterMetaType<ARSObject::Types>("ARSObject::Types");
    qRegisterMetaType<ARSDummyObject *>("ARSDummyObject *");
    qRegisterMetaType<ARSDummyForm *>("ARSDummyForm *");
    qRegisterMetaType<ARSDummyActiveLink *>("ARSDummyActiveLink *");
    qRegisterMetaType<ARSDummyFilter *>("ARSDummyFilter *");
    qRegisterMetaType<ARSDummyField *>("ARSDummyField *");
    qRegisterMetaType<ARSDummyGuide *>("ARSDummyGuide *");

//    Updater updater;
//    if(updater.checkNeedUpdate())
//    {
//        if(QMessageBox::question(0,
//                                 QObject::tr("ARS Illustrator"),
//                                 QObject::tr("New version is avaliable. Do you want to update now?"),
//                                 QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes)
//        {
//            if(!updater.update())
//            {
//                QMessageBox::information(0, QObject::tr("ARS Illustrator"), QObject::tr("Failed to update to the next version. Please contact <a href='http://www.arsillustrator.com/contacts'>support</a>."));
//            }
//        }
//    }

    MainWindow mainWindow;
    mainWindow.show();

    return app.exec();
}
